/**
* Created by ren on 2017/1/6.
var trackData = {
imgUrl: a,
shopName: b,
weight: c,
buyNumber: d,
buyPrice: e,
desc: g
}
*/
<template>
  <div class='track'>
    <div style="margin:20px 30px">
      <div class="goods"
           style="height: 130px;padding: 20px 0;margin: 0 10px;border-top:1px solid #ccc;;border-bottom:1px solid #ccc" v-if="sp!==''" v-for="(item,index) in sp.shopping">
        <img v-lazy="loadImg(item.imgUrl)"
             style="width: 90px;height: 90px;float: left;border: 1px solid #cccccc;margin-right: 20px">
        <div style="float:left;margin-right: 20px;margin-top: 10px">
          <div style="font-size: 18px;margin-bottom: 10px;width: 262px;" class="name">{{item.shopName}}</div>
          <div style="font-size: 16px;color: #666666">{{(item.shopstandardVo.weight/1000).toFixed(1)}}gx{{sp.buyNumber}}</div>
        </div>
        <div style="float:left;margin-right: 20px;font-size: 18px;color:#ff9900;margin-top: 10px" class="desc">

        </div>
        <div style="float:right;font-size: 18px;color: #f05120;margin-top: 20px">¥<span
          style="font-size: 24px">{{(item.shopstandardVo.shopPrice/100).toFixed(2).split('.')[0]}}</span>.{{(item.shopstandardVo.shopPrice/100).toFixed(2).split('.')[1]}}
        </div>
      </div>
      <div style="font-size:20px;color:#333333;margin:30px 0">
        <span>物流状态：</span><span style="color:#e6760a">暂无物流信息</span>
      </div>
      <div style="font-size:16px;margin-bottom:10px">订单编号：{{this.$route.params.orderNo}}</div>
      <div style="font-size:16px">信息来源：顺丰快递</div>
      <div class="track-line" style="border-top:1px solid #ccc;margin-top:30px;padding-top:30px"
           v-if="false">
        <ul>
          <li class="active">
            <div>已签收，签收人是本人签收</div>
            <div>2015-09-17 11:01:01</div>
            <div class="line">
              <img :src="true?require('../../assets/track2.png'):require('../../assets/track1.png')">
            </div>
          </li>
          <li>
            <div>已签收，签收人是本人签收</div>
            <div>2015-09-17 11:01:01</div>
            <div class="line">
              <img :src="false?require('../../assets/track2.png'):require('../../assets/track1.png')">
            </div>
          </li>
          <li class="start">
            <div>已签收，签收人是本人签收</div>
            <div>2015-09-17 11:01:01</div>
            <div class="line">
              <img :src="false?require('../../assets/track2.png'):require('../../assets/track1.png')">
            </div>
          </li>
        </ul>
      </div>
      <div style="color:#fd8f23;margin-top: 40px">
        温馨提示：黄金属贵金属物品请务必亲自开箱检查确认签收。
      </div>
      <button class="btn" style="margin-left:0;color:white;margin-top: 50px" v-if="trackData!==''&&trackData.code!==0">
        确认收货
      </button>
    </div>
    <Notify :parentThis='this'></Notify>
  </div>
</template>

<script>
  import API from '../../api'
  import Notify from '../Notify'
  export default {
    name: 'track',
    components: {
      Notify
    },
    data: function () {
      return {
        notifyStatus: 2,
        trackData: '',
        sp: ''
      }
    },
    props: ['_parentThis'],
    methods: {
      loadImg: function (path) {
        return API.path + path
      },
      getRouteRequest: function () {
        this.$http.post(API.getRouteRequest, {
          orderNo: this.$route.params.orderNo
        }).then((ret) => {
          const result = ret.body
          if (result.code === 1) {
            this.trackData = result.object
          } else {
            this.trackData = {
              code: 0,
              msg: result.message
            }
          }
        }, (err) => {
          this.notifyStatus = '0|' + err
        })
      }
    },
    mounted: function () {
      this.sp = JSON.parse(this.$cookie.get('sp'))
      this._parentThis.titHtml = '<span>购买记录 > <span>商城</span> > <span style="color: #f48315;">查看物流</span></span>'
      this.getRouteRequest()
    }
  }
</script>
